<template>
  <div class="findList" >
    <div class="list" v-for="(item, index) in  list" @click="jumpdetail(item.id,item.title)">
      <img class="left" :src="item.pic"/>
      <div class="right">
        <p class="title">{{item.title}}</p>
        <p class="content">{{item.summary.substring(0,40)}}</p>
        <p class="tag" v-if="item.hassub === 0" >报名</p>
        <p class="tag" v-if="item.hassub === 1" >已报名</p>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "findList",
    data() {
      return {}
    },
    props: {
      list: {
        Type: Array,
        default: () => []
      }
    },
    methods: {
      jumpdetail(id,title) {
        this.$emit('jump', id,title);
      },
    }
  }
</script>

<style scoped lang="less">
  .findList {
    padding:2px 0 140px 0;
    .list {
      position: relative;
      margin: 12px;
      display: flex;
      height: 90px;
      .left {
        padding-right: 10px;
        width: 40%;
      }
      .right {
        width: 60%;
        padding: 4px 0 4px 0;
        text-align: left;
        line-height: 120%;
        position: relative;
        .title {
          font-size: 13px;
          color: black;
          padding-bottom: 2px;
        }
        .content {
          font-size: 12px;
          color: gray;
        }
        .tag {
          position: absolute;
          right: 2px;
          bottom: 2px;
          display: inline-block;
          float: right;
          width: 54px;
          text-align: center;
          padding: 1px 0;
          background-color: cornflowerblue;
          border-radius: 4px;
          color: white;
          font-size: 10px;
          font-weight: bold;
        }
      }
    }
  }
</style>
